using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ApplicationBlocks.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DataHelper.DAL
{
    public class TK_Firm
    {
private static  string m_trConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

       #region TK_FirmSelectAll
        public static SqlDataReader TK_FirmSelectAll(string strSearch="",int top = 1, int bottom = 20, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "TK_FirmSelectAllRows",strSearch,top,bottom);
            return SqlHelper.ExecuteReader(m_trConnectionString, "TK_FirmSelectAllRows",strSearch,top,bottom);
        }
        #endregion
       #region TK_FirmSelectRow
        public static SqlDataReader TK_FirmSelectRow(int ID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "TK_FirmSelectRow", ID);
            return SqlHelper.ExecuteReader(m_trConnectionString, "TK_FirmSelectRow", ID);
        }
        #endregion
       #region TK_FirmInsertRow
        public static void TK_FirmInsertRow(int ID, string Name, string Fullname, int Adult, int Child, int Baby, string Image, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "TK_FirmInsertRow", ID, Name, Fullname, Adult, Child, Baby, Image);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "TK_FirmInsertRow", ID, Name, Fullname, Adult, Child, Baby, Image);
        }
        #endregion
       #region TK_FirmUpdateRow
        public static void TK_FirmUpdateRow(int ID, string Name, string Fullname, int Adult, int Child, int Baby, string Image, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "TK_FirmUpdateRow", ID, Name, Fullname, Adult, Child, Baby, Image);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "TK_FirmUpdateRow", ID, Name, Fullname, Adult, Child, Baby, Image);
        }
        #endregion
       #region TK_FirmDeleteRow
        public static void TK_FirmDeleteRow(int ID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "TK_FirmDeleteRow", ID);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "TK_FirmDeleteRow", ID);
        }
        #endregion

    }
}

